[Ruby on Rails] NoMethodError for underscore

Posted by siulamvictor on Stack Overflow See other posts from Stack Overflow or by siulamvictor
Published on 2010-04-21T08:36:38Z Indexed on 2010/04/21 8:43 UTC
Read the original article Hit count: 338

Filed under:

I want to convert the string

"Full Time"

to

"full_time"

When I using "Full Time".underscore in irb, it prompt a error

NoMethodError: undefined method `underscore' for "Full Time":String

How can I fix it? Or is there any other way for me to get the above underscored result?

© Stack Overflow or respective owner

Related posts about ruby-on-rails